package at.jku.ase.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by IntelliJ IDEA.
 * User: stellit
 * Date: 12/13/11
 * Time: 2:05 PM
 * To change this template use File | Settings | File Templates.
 */
public class ServerMain {

    public static void main(String args[]) {
        System.out.println("Starting server...");
        int serverPort = 9090;
        try {
            ServerSocket server = new ServerSocket(serverPort);
            do {
                Socket client = server.accept();
                System.out.println("Starting new server thread...");
                new ServerThread(client).start();
            } while (true);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
}
